package com.inkyi.assistant.app.todolist.table;

import com.inkyi.framework.daqian.share.jtable.PkTableModel;

import java.util.Arrays;
import java.util.List;
import java.util.Vector;

public class TodoTableModel extends PkTableModel<TodoItem> {

    private final List<Class<?>> columnTypes = Arrays.asList(Long.class, Boolean.class, String.class);

    private final List<Boolean> columnEditable = Arrays.asList(false, true, true);

    private final List<String> columnNames = Arrays.asList("id", "isFinish", "title");

    public TodoTableModel() {
        setDataVector(new Vector<Vector<String>>(), new Vector<>(columnNames));
    }

    @Override
    public Class<?> getColumnClass(int columnIndex) {
        return columnTypes.get(columnIndex);
    }

    @Override
    public boolean isCellEditable(int rowIndex, int columnIndex) {
        return columnEditable.get(columnIndex);
    }

}
